import { http } from "@/utils/http";
import { baseUrlApi } from "@/api/utils";
type Result = {
  current_page: number;
  result?: any;
  per_page?: number;
  total?: number;
  data?: any;
};
type ResultCreate = {
  code: number;
  msg: string;
};
type ResultDelete = {
  code: number;
};
type Show = {
  code: number;
  msg: string;
  result?: any;
};
/** 列表 */
export const getTaskList = (params?: object) => {
  return http.request<Result>("get", "/dashboard/task/list", {
    params
  });
};

/** 添加*/
export const create = (data?: object) => {
  return http.request<ResultCreate>("post", "/dashboard/task/create", {
    data
  });
};
/** 任务反馈接口*/
export const taskApi = (data?: object) => {
  return http.request<Result>("get", "/dashboard/task/feedback", {
    data
  });
};
/** 删除*/
export const del = (data?: object) => {
  return http.request<ResultDelete>("delete", "/dashboard/task/delete", {
    data
  });
};
/** 详情 */
export const getTaskShow = (params?: object) => {
  return http.request<Show>("get", "/dashboard/task/show", {
    params
  });
};
